From 35f5120afcf158e445062fdb5072684ed24d91d0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 17 Oct 2021 11:16:27 +0200 Subject: [PATCH] rule.uc: always format ICMP type/code list as set Ensure that the concatenated type . code list values are always formatted as anonymous set, even if the list just contains one item. Fixes the following nftables error when parsing such a rule: Error: Use concatenations with sets and maps, not singleton values Signed-off-by: Jo-Philipp Wich --- root/usr/share/firewall4/templates/rule.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/usr/share/firewall4/templates/rule.uc b/root/usr/share/firewall4/templates/rule.uc index 0aae480..5f1b696 100644 --- a/root/usr/share/firewall4/templates/rule.uc +++ b/root/usr/share/firewall4/templates/rule.uc @@ -28,7 +28,7 @@ {{ (rule.family == 4) ? "icmp" : "icmpv6" }} type {{ fw4.set(rule.icmp_types) }} {%+ endif -%} {%+ if (rule.icmp_codes): -%} {{ (rule.family == 4) ? "icmp" : "icmpv6" }} type . {{ (rule.family == 4) ? "icmp" : "icmpv6" }} code {{ - fw4.set(rule.icmp_codes) + fw4.set(rule.icmp_codes, true) }} {%+ endif -%} {%+ if (rule.helper): -%} ct helper{% if (rule.helper.invert): %} !={% endif %} {{ fw4.quote(rule.helper.name, true) }} {%+ endif -%} -- 2.30.2